import type { ProDescriptionsItemProps } from '@/components/ProDescriptions';
import ProDescriptions from '@/components/ProDescriptions';
import React from 'react';
import type { UserItem } from '../data';

const LockerDetail: React.FC<{
  id?: string;
  request: (id: string) => Promise<{ success: boolean; data?: UserItem }>;
}> = ({ id = '', request }) => {
  // @ts-ignore
  const columns: ProDescriptionsItemProps<UserItem>[] = [
    {
      label: '管理员名称',
      dataIndex: 'name',
    },
    {
      label: '管理员账号',
      dataIndex: 'userName',
    },
  ];

  return (
    <div>
      <ProDescriptions
        title="业主详情"
        column={1}
        columns={columns}
        params={{ id }}
        request={(params) => request(params.id)}
      />
    </div>
  );
};

export default LockerDetail;
